package com.amap.demo.view;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 高德地图demo
 *
 * @author jacksen
 */
public class MainActivity extends AppCompatActivity implements View.OnClickListener {


    @Bind(R.id.btn1)
    Button btn1;
    @Bind(R.id.btn2)
    Button btn2;
    @Bind(R.id.btn3)
    Button btn3;
    @Bind(R.id.btn4)
    Button btn4;
    @Bind(R.id.btn5)
    Button btn5;
    @Bind(R.id.btn6)
    Button btn6;
    @Bind(R.id.btn7)
    Button btn7;
    @Bind(R.id.btn8)
    Button btn8;
    @Bind(R.id.btn9)
    Button btn9;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);

        init();
    }


    /**
     * 初始化操作
     */
    private void init() {

    }


    @OnClick({R.id.btn1, R.id.btn2, R.id.btn3, R.id.btn4, R.id.btn5, R.id.btn6, R.id.btn7, R.id.btn8, R.id.btn9})
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn1:
                startActivity(BasicMapActivity.class);
                break;
            case R.id.btn2:
                startActivity(MapControllActivity.class);
                break;
            case R.id.btn3:
                startActivity(LocationActivity.class);
                break;
            case R.id.btn4:
                startActivity(AddOverlayActivity.class);
                break;
            case R.id.btn5:
                startActivity(PoiSearchActivity.class);
                break;
            case R.id.btn6:
                startActivity(RoutePlanningActivity.class);
                break;
            case R.id.btn7:
                startActivity(GeoOrResGeoActivity.class);
                break;
            case R.id.btn8:
                startActivity(DownloadMapActivity.class);
                break;
            case R.id.btn9:
                startActivity(MarkersClusterActivity.class);
                break;
            default:

                break;
        }
    }

    /**
     * @param clazz
     */
    private void startActivity(Class clazz) {
        this.startActivity(new Intent(this, clazz));
    }
}
